<?php include_once 'checkloginstatus.php';?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>瑞邦晟达科技</title>
    <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
			$("#formUpload").validate({
				errorElement:"span",
				errorClass:"errorMsg",
				rules:{
					txtName:{
						required:true
					}
				},
				messages:{
					txtName:{
						required:"文件名称不能为空！"
					}
				}
			});
        })
    </script>
</head>
<body>
<form enctype="multipart/form-data" action="productimgmanage.php" id="formUpload" method="post">
    <p>文件名称：<input type="text" name="txtName" id="txtName" /></p>
    <p>添加新文件：<input type="file" name="image" id="imgUpload" value="浏览" /></p>
    <p><input type="hidden" name="pid" value="<?php echo $_GET['pid'];?>" /><input type="submit" name="btnAddPic" id="btnAddPic" value="上传图片" /></p>
</form>

<table>
	<tr>
	    <td>序号</td>
	    <td>名称</td>
	    <td>添加时间</td>
	    <td>删除</td>
	</tr>
	<?php 
	    include_once '../mysqldb/MySqlHelper.php';
	    $MySqlHelper = new MySqlHelper();
	    $rows = $MySqlHelper->GetRows('select * from ProductShow where PID = '.$_GET['pid']);
	    $i=1;
	    while ($row=$rows->fetch_assoc()) {
	?>
	<tr>
	    <td><?php echo $i;?></td>
	    <td><?php echo $row['ProductName'];?></td>
	    <td><?php echo $row['AddTime'];?></td>
	    <td><a href="productimgdel.php?id=<?php echo $row['ID'];?>&pid=<?php echo $_GET['pid'];?>">删除</a></td>    
	</tr>
	<?php 
	        $i+=1;
	    }
	     
	?>
</table>
</body>
</html>